# Maintainer: David Runge <dave@sleepmap.de>
pkgname=yass
pkgver=0.1.0
pkgrel=2
pkgdesc="Yet Another Scrolling Scope"
arch=('loong64' 'x86_64')
url="https://kokkinizita.linuxaudio.org/linuxaudio/"
license=('GPL2')
groups=('pro-audio')
depends=('clthreads' 'clxclient' 'jack')
makedepends=('gendesk')
backup=('etc/yass.conf')
source=("https://kokkinizita.linuxaudio.org/linuxaudio/downloads/$pkgname-$pkgver.tar.bz2")
sha512sums=('c8107368ea014c0f078cd73df325aa68e15af2ce8797e02dbcc4cff4b03b753f9dd7301d9ef675960021a94ca47354cc93cae3f0e8abbbece54d9333ee4f77a2')
validpgpkeys=()

prepare() {
  cd "$pkgname-$pkgver"
  sed -e '/native/d' \
      -i source/Makefile
  # XDG desktop files
  gendesk -n \
          --pkgname ${pkgname} \
          --pkgdesc "${pkgdesc}" \
          --name YASS \
          --categories "AudioVideo;Audio"
}

build() {
  cd "$pkgname-$pkgver/source"
  make
}

package() {
  cd "$pkgname-$pkgver/source"
  make DESTDIR="${pkgdir}" PREFIX="/usr" install
  # XDG desktop integration
  install -vDm 644 "../${pkgname}.desktop" \
    -t "${pkgdir}/usr/share/applications/"
  # docs
  install -vDm 644 ../{AUTHORS,README} -t "${pkgdir}/usr/share/doc/${pkgname}/"
  # configuration
  install -vDm 644 ../.yassrc "${pkgdir}/etc/yass.conf"
}
